package com.feiyu.shopsAndgoods.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.feiyu.shopsAndgoods.entity.CheckShopEntity;
import com.feiyu.shopsAndgoods.service.CheckShopService;
import com.feiyu.common.utils.PageUtils;
import com.feiyu.common.utils.R;



/**
 * 
 *
 * @author wanghanbin
 * @email 1336891708@qq.com
 * @date 2021-04-03 12:36:05
 */
@RestController
@RequestMapping("product/checkshop")
public class CheckShopController {
    @Autowired
    private CheckShopService checkShopService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("product:checkshop:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = checkShopService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{checkShopId}")
    //@RequiresPermissions("product:checkshop:info")
    public R info(@PathVariable("checkShopId") Integer checkShopId){
		CheckShopEntity checkShop = checkShopService.getById(checkShopId);

        return R.ok().put("checkShop", checkShop);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("product:checkshop:save")
    public R save(@RequestBody CheckShopEntity checkShop){
		checkShopService.save(checkShop);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("product:checkshop:update")
    public R update(@RequestBody CheckShopEntity checkShop){
		checkShopService.updateById(checkShop);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("product:checkshop:delete")
    public R delete(@RequestBody Integer[] checkShopIds){
		checkShopService.removeByIds(Arrays.asList(checkShopIds));

        return R.ok();
    }

}
